const express = require('express')
const app = express()
const router = require('./router.js')

/**
 * 挂载路由
 *  ● http://127.0.0.1/get
 *  ● http://127.0.0.1/post
 */
app.use(router)

/**
 * 挂载路由，并添加访问前缀
 *  ● http://127.0.0.1/api/get
 *  ● http://127.0.0.1/api/post
 */
app.use('/api', router)

app.listen(80, () => {
  console.log('Server running at http://127.0.0.1')
})
